//
//  QTWebPageViewController.m
//  qdqts
//
//  Created by centling on 14-7-24.
//  Copyright (c) 2014年 seas.cheng. All rights reserved.
//

#import "QTWebPageViewController.h"

@interface QTWebPageViewController ()

@end

@implementation QTWebPageViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.navigationController.navigationBarHidden=NO;
    self.navigationItem.title=@"扫码";
    self.webView.scalesPageToFit =YES;
    self.webView.delegate =self;
    NSURL *url =[NSURL URLWithString:self.urlString];
    NSLog(@"%@",self.urlString);
    NSURLRequest *request =[NSURLRequest requestWithURL:url];
    [self.webView loadRequest:request];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)webViewDidStartLoad:(UIWebView *)webView
{
    [self.refresh startAnimating] ;
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [self.refresh stopAnimating];
}



- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
    UIAlertView *alterview = [[UIAlertView alloc] initWithTitle:@"" message:[error localizedDescription]  delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
    [alterview show];
    [self.refresh stopAnimating];
}
@end
